package com.du.managerback.service;

import com.du.managerback.entily.Employee;
import com.du.managerback.mapper.EmployeeMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeService {
    @Resource
    EmployeeMapper employeeMapper;
    public PageInfo<Employee> setAll(Integer pageNum,Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Employee> info=employeeMapper.selectAll();
        return PageInfo.of(info);
    }

    public Employee selectById(Integer id) {
        return employeeMapper.selectById(id);
    }
}
